package com.jxsd.edu.cn.struts2.actions;

import java.util.List;

import com.jxsd.edu.cn.struts2.models.Category;
import com.jxsd.edu.cn.struts2.models.PubMsgview;
import com.jxsd.edu.cn.struts2.serviceImpl.CatagoryServiceImpl;
import com.jxsd.edu.cn.struts2.serviceImpl.SearchPubMsgServiceImpl;
import com.jxsd.edu.cn.struts2.services.CatagoryService;
import com.jxsd.edu.cn.struts2.services.SearchPubMsgService;
import com.jxsd.edu.cn.tools.Page;
import com.jxsd.edu.cn.tools.PageBean;

/**
 * 处理搜索帖子的请求
 * */

public class SearchAction 
{
	//搜索关键字
   private  String  keyword;
   //搜索的结果页面
   private  Page<PubMsgview>  page;
   //搜索结果的请求分页器
   private  PageBean<PubMsgview>  pagebean;
   //一级类别信息
  	private     List<Category>   list;
   //搜索服务
   private  SearchPubMsgService  searService=new  SearchPubMsgServiceImpl();
   //IndexService
   private     CatagoryService   cataService;
   
   public  SearchAction()
   {
	   cataService=new  CatagoryServiceImpl();
   }
   
   //处理搜索物品发布记录
   public  String  doSearch()
   {
	   //获取导航
	   list=cataService.getAllCatagory();
	   page=searService.doDearch(pagebean, keyword);
	   return "success";
   }
   
   
   
   
   
	public String getKeyword() {
		return keyword;
	}
	
	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}
	
	public Page<PubMsgview> getPage() {
		return page;
	}
	
	public void setPage(Page<PubMsgview> page) {
		this.page = page;
	}
	
	
	public PageBean<PubMsgview> getPagebean() {
		return pagebean;
	}
	
	
	public void setPagebean(PageBean<PubMsgview> pagebean) {
		this.pagebean = pagebean;
	}

	public List<Category> getList() {
		return list;
	}

	public void setList(List<Category> list) {
		this.list = list;
	}
}
